/* Upgrades is a standalone dialog; residents are in the living quarters. */
.shelter-system-modal[hidden] { display: none !important; }
.shelter-system-modal.modal { z-index: 1200; padding: 16px; overflow: hidden; }
.shelter-system-modal > .shelter-system-window.modal__content {
  width: min(1000px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden !important;
  border-radius: 14px;
  background: var(--surface-1, #0b100d);
  zoom: 1 !important;
  transform: none !important;
}
.shelter-system-window__header { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.shelter-system-window__header > div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.shelter-system-window__header h2 { margin: 0; font-size: 20px; }
.shelter-system-window__header button { flex: 0 0 auto; min-width: 64px; min-height: 44px; }
.shelter-system-window__body { flex: 1 1 auto; min-height: 0; padding: 18px 20px 20px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; }
.shelter-system-window .upgrade-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 12px; max-height: none; }
.shelter-system-window .empty-state { grid-column: 1 / -1; }
.shelter-system-window .upgrade-card { min-width: 0; }
.shelter-system-window .button { min-height: 44px; }
.shelter-system-window #shelterUpgradeLevelGuide { margin: 0 0 16px; line-height: 1.5; }
/* Compatibility inventory/storage workspace no longer has a tab row. */
#dashboardModal .dashboard-workspace { grid-template-rows: auto minmax(0, 1fr); }
@media (max-width: 640px) {
  .shelter-system-modal.modal { padding: 8px; }
  .shelter-system-modal > .shelter-system-window.modal__content {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
  }
  .shelter-system-window__header { padding: 10px 14px; }
  .shelter-system-window__header h2 { font-size: 18px; }
  .shelter-system-window__body { padding: 14px; }
  .shelter-system-window .upgrade-list { grid-template-columns: minmax(0, 1fr); }
}
